import gfo.Tournament
import gfo.Stage
import gfo.Match
import gfo.Player
import gfo.Fighter
import gfo.Matchship
import gfo.Bracket

class BootStrap {

    def init = { servletContext ->

        //SETUP-------------------------------------------
        //Initialize all 35 characters, all 41 stages and all 4 brackets, if nothing there.
        if (!Fighter.get(1) && !Stage.get(1) && !Bracket.get(1)){//careful here, might be dangerous to assume
            //FIGHTERS------------------------------------------------------
            def mario = new Fighter(name: 'Mario')
            def luigi = new Fighter(name: 'Luigi')
            def peach = new Fighter(name: 'Peach')
            def bowser = new Fighter(name: 'Bowser')
            def dk = new Fighter(name: 'Donkey Kong')
            def diddy = new Fighter(name: 'Diddy Kong')
            def yoshi = new Fighter(name: 'Yoshi')
            def wario = new Fighter(name: 'Wario')
            def link = new Fighter(name:  'Link')
            def zs = new Fighter(name: 'Zelda')//think about this one
            def ganon = new Fighter(name: 'Ganondorf')
            def tlink = new Fighter(name: 'Toon Link')
            def samus = new Fighter(name: 'Samus')
            def zss = new Fighter(name: 'Zero Suit Samus')
            def pit = new Fighter(name: 'Pit')
            def ic = new Fighter(name:  'Ice Climbers')
            def rob = new Fighter(name: 'R.O.B.')
            def kirby = new Fighter(name: 'Kirby')
            def mk = new Fighter(name: 'Meta Knight')
            def kddd = new Fighter(name: 'King Dedede')
            def olimar = new Fighter(name: 'Olimar')
            def fox = new Fighter(name: 'Fox')
            def falco = new Fighter(name: 'Falco')
            def wolf =  new Fighter(name: 'Wolf')
            def cf = new Fighter(name: 'Captain Falcon')
            def pikachu = new Fighter(name: 'Pikachu')
            def pt = new Fighter(name: 'Pokemon Trainer')
            def lucario = new Fighter(name: 'Lucario')
            def jiggly = new Fighter(name: 'Jigglypuff')
            def marth = new Fighter(name: 'Marth')
            def ike = new Fighter(name: 'Ike')
            def ness = new Fighter(name: 'Ness')
            def lucas = new Fighter(name: 'Lucas')
            def mgw = new Fighter(name: 'Mr. Game & Watch')
            def snake = new Fighter(name: 'Snake')
            def sonic = new Fighter(name: 'Sonic')

            //STAGES--------------------------------------------------
            def battlefield = new Stage(name: 'Battlefield')
            def finalD = new Stage(name: 'Final Destination')
            def delfino = new Stage(name: 'Delfino Plaza')
            def mansion = new Stage(name: 'Luigi\'s Mansion')
            def mushroomy = new Stage(name: 'Mushroomy Kingdom')
            def mCircuit = new Stage(name: 'Mario Circuit')
            def m75 = new Stage(name: '75m')
            def rumbleFalls = new Stage(name: 'Rumble Falls')
            def pirateShip = new Stage(name: 'Pirate Ship')
            def eldin = new Stage(name: 'Bridge of Eldin')
            def norfair = new Stage(name:  'Norfair')
            def orpheon = new Stage(name: 'Frigate Orpheon')
            def yIsland = new Stage(name: 'Yoshi\'s Island')
            def halberd = new Stage(name: 'Halberd')
            def lCruise = new Stage(name: 'Lylat Cruise')
            def pkSt2 = new Stage(name: 'Pokemon Stadium 2')
            def sPillar = new Stage(name: 'Spear Pillar')
            def aeroDive = new Stage(name: 'Port Town Aero Dive')
            def summit = new Stage(name: 'Summit')
            def fZ2 = new Stage(name: 'Flat Zone 2')
            def castle = new Stage(name: 'Castle Siege')
            def warioWare = new Stage(name: 'WarioWare, Inc.')
            def dPlanet = new Stage(name: 'Distant Planet')
            def skyWorld = new Stage(name: 'Skyworld')
            def mBros = new Stage(name: 'Mario Bros.')
            def nPC = new Stage(name: 'New Pork City')
            def smashville = new Stage(name: 'Smashville')
            def sMoses = new Stage(name: 'Shadow Moses Island')
            def gHZ = new Stage(name: 'Green Hill Zone')
            def pictoChat = new Stage(name: 'PictoChat')
            def hanenbow = new Stage(name: 'Hanenbow')
            def temple = new Stage(name: 'Temple')
            def mYIsland = new Stage(name: 'Yoshi\'s Island (Melee)')
            def japes = new Stage(name: 'Jungle Japes')
            def onett = new Stage(name: 'Onett')
            def greens = new Stage(name: 'Green Greens')
            def rCruise = new Stage(name: 'Rainbow Cruise')
            def corneria = new Stage(name: 'Corneria')
            def blue = new Stage(name: 'Big Blue')
            def brinstar = new Stage(name: 'Brinstar')
            def pkSt = new Stage(name: 'Pokemon Stadium (Melee)')

            //BRACKETS-------------------------------------------------
            def rrobin = new Bracket(name: "Round Robin")
            def qfinals = new Bracket(name: "Quarter Finals")
            def sfinals = new Bracket(name: "Semi Finals")
            def finals = new Bracket(name: "Finals")

            //SAVES-----------------------------------------------------
            //---FIGHTERS--------------
            mario.save()
            luigi.save()
            peach.save()
            bowser.save()
            dk.save()
            diddy.save()
            yoshi.save()
            wario.save()
            link.save()
            zs.save()
            ganon.save()
            tlink.save()
            samus.save()
            zss.save()
            pit.save()
            ic.save()
            rob.save()
            kirby.save()
            kddd.save()
            mk.save()
            olimar.save()
            fox.save()
            falco.save()
            wolf.save()
            cf.save()
            pikachu.save()
            pt.save()
            lucario.save()
            jiggly.save()
            marth.save()
            ike.save()
            ness.save()
            lucas.save()
            mgw.save()
            snake.save()
            sonic.save()

            //---STAGES-----------------
            battlefield.save()
            finalD.save()
            delfino.save()
            mansion.save()
            mushroomy.save()
            mCircuit.save()
            m75.save()
            rumbleFalls.save()
            pirateShip.save()
            eldin.save()
            norfair.save()
            orpheon.save()
            yIsland.save()
            halberd.save()
            lCruise.save()
            pkSt2.save()
            sPillar.save()
            aeroDive.save()
            summit.save()
            fZ2.save()
            castle.save()
            warioWare.save()
            dPlanet.save()
            skyWorld.save()
            mBros.save()
            nPC.save()
            smashville.save()
            sMoses.save()
            gHZ.save()
            pictoChat.save()
            hanenbow.save()
            temple.save()
            mYIsland.save()
            japes.save()
            onett.save()
            greens.save()
            rCruise.save()
            blue.save()
            corneria.save()
            brinstar.save()
            pkSt.save()

            //---BRACKETS--------
            rrobin.save()
            qfinals.save()
            sfinals.save()
            finals.save()
        }
    }

    def destroy = {
    }
}
